package com.guaoran.source.mybatis.config;

import lombok.Data;

import java.io.IOException;

/**
 * @author : 孤傲然
 * @Description :
 * @date :2018/5/25 23:15
 */
@Data
public class Configuration {
    private MapperRegistory mapperRegistory = new MapperRegistory();
    private String scanPath;

    public MapperRegistory getMapperRegistory() {
        return mapperRegistory;
    }

    public void setMapperRegistory(MapperRegistory mapperRegistory) {
        this.mapperRegistory = mapperRegistory;
    }

    public String getScanPath() {
        return scanPath;
    }

    public void setScanPath(String scanPath) {
        this.scanPath = scanPath;
    }

    public Configuration scanPath(String scanPath) {
        this.scanPath = scanPath;
        return this;
    }

    public void build() throws IOException {
        if (null == scanPath || scanPath.length() < 1) {
            throw new RuntimeException("scan path is required .");
        }
    }
}
